import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/reset.css';
import * as Icons from '@ant-design/icons-vue';
import { ConfigProvider } from 'ant-design-vue';
export default defineNuxtPlugin((nuxtApp) => {
  if (!nuxtApp.vueApp._context.config.globalProperties.$antdRegistered) {
    nuxtApp.vueApp.use(Antd);
    nuxtApp.vueApp.component('a-config-provider', ConfigProvider);
    
    const icons = Icons;
    for (const i in icons) {
      nuxtApp.vueApp.component(i, (icons as any)[i]);
    }
    
    nuxtApp.vueApp._context.config.globalProperties.$antdRegistered = true;
  }
})